VERSION 5.00
Begin VB.Form frmBSO 
   BackColor       =   &H00FFFFFF&
   Caption         =   "Broker Select option Information"
   ClientHeight    =   3960
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   9975
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   ScaleHeight     =   3960
   ScaleWidth      =   9975
   StartUpPosition =   1  'CenterOwner
   Begin VB.Frame Frame4 
      BackColor       =   &H00FFFFFF&
      Caption         =   " Enter the address where the FedEx package should be held "
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000080FF&
      Height          =   3135
      Left            =   120
      TabIndex        =   16
      Top             =   120
      Width           =   9735
      Begin VB.ComboBox f1187 
         Height          =   315
         Left            =   1680
         TabIndex        =   0
         Top             =   360
         Width           =   3015
      End
      Begin VB.TextBox f1345 
         Height          =   315
         Left            =   6360
         TabIndex        =   12
         Top             =   2160
         Width           =   3015
      End
      Begin VB.TextBox f1179 
         Height          =   315
         Left            =   6360
         TabIndex        =   13
         Top             =   2520
         Width           =   3015
      End
      Begin VB.TextBox f1343 
         Height          =   315
         Left            =   6360
         TabIndex        =   10
         Top             =   1440
         Width           =   3015
      End
      Begin VB.TextBox f1344 
         Height          =   315
         Left            =   6360
         TabIndex        =   11
         Top             =   1800
         Width           =   3015
      End
      Begin VB.TextBox f1180 
         Height          =   315
         Left            =   1680
         TabIndex        =   3
         Top             =   1440
         Width           =   3015
      End
      Begin VB.TextBox f66 
         Height          =   315
         Left            =   1680
         TabIndex        =   2
         Top             =   1080
         Width           =   3015
      End
      Begin VB.TextBox f1183 
         Height          =   315
         Left            =   1680
         TabIndex        =   6
         Top             =   2520
         Width           =   3015
      End
      Begin VB.TextBox f1185 
         Height          =   315
         Left            =   6360
         TabIndex        =   8
         Top             =   720
         Width           =   3015
      End
      Begin VB.TextBox f1181 
         Height          =   315
         Left            =   1680
         TabIndex        =   4
         Top             =   1800
         Width           =   3015
      End
      Begin VB.TextBox f1182 
         Height          =   315
         Left            =   1680
         TabIndex        =   5
         Top             =   2160
         Width           =   3015
      End
      Begin VB.TextBox f67 
         Height          =   315
         Left            =   6360
         TabIndex        =   9
         Top             =   1080
         Width           =   3015
      End
      Begin VB.ComboBox f1184 
         Height          =   315
         Left            =   6360
         TabIndex        =   7
         Top             =   360
         Width           =   3015
      End
      Begin VB.ComboBox f1186 
         Height          =   315
         Left            =   1680
         TabIndex        =   1
         Top             =   720
         Width           =   3015
      End
      Begin VB.Label Label15 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Account Number:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   30
         Top             =   2580
         Width           =   1455
      End
      Begin VB.Label Label14 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Pager Number:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   29
         Top             =   2220
         Width           =   1455
      End
      Begin VB.Label Label12 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Email Address:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   28
         Top             =   1500
         Width           =   1455
      End
      Begin VB.Label Label11 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Fax Number:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   27
         Top             =   1860
         Width           =   1455
      End
      Begin VB.Label Label3 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Broker Company:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   26
         Top             =   1500
         Width           =   1455
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Broker Name:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   24
         Top             =   1140
         Width           =   1455
      End
      Begin VB.Label Label7 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Address 1:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   23
         Top             =   1860
         Width           =   1455
      End
      Begin VB.Label Label6 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Country:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   22
         Top             =   780
         Width           =   1455
      End
      Begin VB.Label Label5 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Zip:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   21
         Top             =   780
         Width           =   1455
      End
      Begin VB.Label Label4 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "State:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   20
         Top             =   420
         Width           =   1455
      End
      Begin VB.Label Label10 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Address 2:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   19
         Top             =   2220
         Width           =   1455
      End
      Begin VB.Label Label8 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "City:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   18
         Top             =   2580
         Width           =   1455
      End
      Begin VB.Label Label9 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Telephone:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   17
         Top             =   1140
         Width           =   1455
      End
      Begin VB.Label Label2 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Broker ID:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   25
         Top             =   420
         Width           =   1455
      End
   End
   Begin VB.CommandButton cmdSave 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "Save/Exit"
      Height          =   315
      Left            =   3480
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   14
      Top             =   3480
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton cmdCancel 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "Cancel"
      Height          =   315
      Left            =   5280
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   15
      Top             =   3480
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
End
Attribute VB_Name = "frmBSO"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


'---------------------------------------------------------------------------------------
' Procedure : LoadAddrFields()
' DateTime  : 2007-12-01
' Purpose   : Loads recipient info onto form.  Developed for Bombardier.
' Call from :
'---------------------------------------------------------------------------------------
'
Private Sub LoadAddrFields(ByVal strLookupFld As String, ByVal strValue As String)
    On Error GoTo EH
    g_strErrorLocation = Me.name & ":LoadAddrFields"
    
    Dim strQuery As String
    Dim rsCustomer As New ADODB.Recordset
    
    strQuery = "SELECT * FROM AddressBook WHERE " & strLookupFld & " = " & SingleQuotes(strValue)
    rsCustomer.Open strQuery, g_connFSMSClient, adOpenKeyset, adLockOptimistic
    If Not rsCustomer.EOF Then
        f1187 = rsCustomer!CustID
        f1186 = rsCustomer!f50
        f1180 = rsCustomer!f11
        f66 = rsCustomer!f12
        f1181 = rsCustomer!f13
        f1182 = rsCustomer!f14
        f1183 = rsCustomer!f15
        f1184 = rsCustomer!f16
        f1185 = rsCustomer!f17
        f67 = rsCustomer!f18
        f1179 = rsCustomer!f20
        f1343 = rsCustomer!f1202
    End If
    
Release:
    If rsCustomer.State = adStateOpen Then rsCustomer.Close
    Set rsCustomer = Nothing
    Exit Sub

EH:
    MsgBox Err.Description, vbCritical, g_strErrorLocation
    Resume Release

End Sub



'---------------------------------------------------------------------------------------
' Procedure : cmdCancel_Click()
' DateTime  : 2/18/2004
' Purpose   : Cancel button hides form
'---------------------------------------------------------------------------------------
'
Private Sub cmdCancel_Click()
    Me.Hide
    frmShip.SetFocus
End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdSave_Click()
' DateTime  : 2/18/2004
' Purpose   : Save button assigns BSO fields to global vars
'---------------------------------------------------------------------------------------
'
Private Sub cmdSave_Click()
    
    g_str66 = f66
    g_str67 = f67
    g_str1179 = f1179
    g_str1180 = f1180
    g_str1181 = f1181
    g_str1182 = f1182
    g_str1183 = f1183
    g_str1184 = f1184
    g_str1185 = f1185
    g_str1186 = Left(f1186, 2)
    g_str1187 = f1187
    g_str1343 = f1343
    g_str1344 = f1344
    g_str1345 = f1345
    
    Me.Hide
    frmShip.SetFocus
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1179_Change()
' DateTime  : 2/18/2004
' Purpose   : Broker Acct# is numeric with a max length of 9
'---------------------------------------------------------------------------------------
'
Private Sub f1179_Change()
    Call NumericOnly(f1179, False)
    Call CheckLength(f1179, 9)
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1184_Change()
' DateTime  : 8/9/2004
' Purpose   : Calls a routine to populate the entire text of selected state.
'---------------------------------------------------------------------------------------
'
Private Sub f1184_Change()
    If Len(f1184) >= 2 Then
        Call SetComboSelection(f1184, f1184)
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1186_Change()
' DateTime  : 2/18/2004
' Modified  : 11/10/2004 fixed Country code being cleared.
' Purpose   : If Broker Country is US load State combo.
'---------------------------------------------------------------------------------------
'
Private Sub f1186_Change()
    
    If Len(f1186) >= 2 Then
        Call SetComboSelection(f1186, f1186)
    End If
    
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1186_Click()
' DateTime  : 2/18/2004
' Purpose   : If US load states, if CA load provinces, else clear state combo
'---------------------------------------------------------------------------------------
'
Private Sub f1186_Click()
    
    If Left(f1186, 2) = "US" Then
        Call LoadStates(f1184)
    ElseIf Left(f1186, 2) = "CA" Then
        Call LoadProvinces(f1184)
    Else
        f1184.Clear
    End If

End Sub


' 2007-12-01, JFW, Lookup from AddressBook.  Developed for Bombardier.

Private Sub f1187_KeyPress(KeyAscii As Integer)

    Call SearchCombo(f1187, KeyAscii)

End Sub

Private Sub f1187_LostFocus()

    Dim strQuery As String
    Dim rsQuery As ADODB.Recordset
    
    If f1187 <> "" Then
        Call LoadAddrFields("CustID", f1187)
    End If

End Sub

'---------------------------------------------------------------------------------------
' Procedure : f1344_Change()
' DateTime  : 2/18/2004
' Purpose   : Fax # is numeric only
'---------------------------------------------------------------------------------------
'
Private Sub f1344_Change()
    Call NumericOnly(f1344, False)
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f1345_Change()
' DateTime  : 2/18/2004
' Purpose   : Pager number is numeric only.
'---------------------------------------------------------------------------------------
'
Private Sub f1345_Change()
    Call NumericOnly(f1345, False)
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f67_Change()
' DateTime  : 2/18/2004
' Purpose   : Broker phone is numeric only
'---------------------------------------------------------------------------------------
'
Private Sub f67_Change()
    Call NumericOnly(f67, False)
End Sub
'---------------------------------------------------------------------------------------
' Procedure : Form_Activate()
' DateTime  : 11/11/2004
' Purpose   : Set Country Code to Recipient Country Code
'---------------------------------------------------------------------------------------
'
Private Sub Form_Activate()
    f1186 = Left(frmShip.f50, 2)
    f1187.SetFocus
End Sub
'---------------------------------------------------------------------------------------
' Procedure : Form_KeyDown()
' DateTime  : 2/17/2005
' Purpose   : Enter key pressed sends a TAB to move to next field
'---------------------------------------------------------------------------------------
'
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If Not TypeOf Me.ActiveControl Is CommandButton Then
        If Shift = 0 And KeyCode = 13 Then
            SendKeys "{TAB}"
        End If
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : Form_Load()
' DateTime  : 2/18/2004
' Purpose   : Form Load, load State and Country combos, set Country to US.
'---------------------------------------------------------------------------------------
'
Private Sub Form_Load()
    'Initialize State combo
    Call LoadStates(f1184)
    
    'Initialize Countries combo
    Call LoadCountries(f1186)
    f1186.ListIndex = 180

    Call frmShip.LoadAddrLookupCombos(f1187, f1187, "CustID")

End Sub
